import requests
while True:
    city=input('请输入城市，回车退出：\n')
    if not city:
        break
    try:
        req=requests.get(f' http://api.tangdouz.com/tq.php?dz={city}')
        print(req.text)
    except:
        print('查询失败')
        break

    

